<template>
  <div class="grade">
    <!-- 头部 -->
    <h3>团长等级</h3>
    <div class="teamInner">
      <!-- 表格 -->
      <div class="table">
        <el-table :data="tableData" border style="width: 100%">
          <el-table-column label="等级名称" width="300">
            <template slot-scope="scope">
              <span style="margin-left: 10px">{{ scope.row.name }}</span>
            </template>
          </el-table-column>

          <el-table-column label="等级经验" width="300">
            <template slot-scope="scope">
              <span style="margin-left: 10px">{{ scope.row.jiny }}</span>
            </template>
          </el-table-column>

          <el-table-column label="奖励比例(%)" width="300">
            <template slot-scope="scope">
              <span style="margin-left: 10px">{{ scope.row.li }}</span>
            </template>
          </el-table-column>

          <el-table-column label="创建时间" width="250">
            <template slot-scope="scope">
              <span style="margin-left: 10px">{{ scope.row.time }}</span>
            </template>
          </el-table-column>

          <el-table-column label="状态" width="356">
            <template slot-scope="scope">
              <el-switch
                v-model="scope.row.state"
                active-color="#13ce66"
                :active-value="1"
                inactive-color="#ff4949"
                @change="onChange($event, scope.row.lls)"
              ></el-switch>
            </template>
          </el-table-column>

          <el-table-column label="操作" width="370">
            <template slot-scope="scope">
              <el-button @click="handleClick(scope.row)" type="text" size="small">
                <i class="el-icon-edit"></i>
              </el-button>
              <el-button type="text" size="small">
                <i class="el-icon-delete"></i>
              </el-button>
            </template>
          </el-table-column>
        </el-table>
        <!-- <el-table :data="tableData" style="width: 100%">
          <el-table-column label="等级名称" width="300">
            <template slot-scope="scope">
              <span style="margin-left: 10px">{{ scope.row.name }}</span>
            </template>
          </el-table-column>
          <el-table-column label="等级经验" width="300">
            <template slot-scope="scope">
              <span style="margin-left: 10px">{{ scope.row.jiny }}</span>
            </template>
          </el-table-column>
          <el-table-column label="奖励比例(%)" width="300">
            <template slot-scope="scope">
              <span style="margin-left: 10px">{{ scope.row.li }}</span>
            </template>
          </el-table-column>
          <el-table-column label="创建时间" width="250">
            <template slot-scope="scope">
              <span style="margin-left: 10px">{{ scope.row.time }}</span>
            </template>
          </el-table-column>
          <el-table-column label="状态" width="356">
            <template slot-scope="scope">
              <el-switch
                v-model="scope.row.state"
                active-color="#13ce66"
                :active-value="1"
                inactive-color="#ff4949"
                @change="onChange($event, scope.row.lls)"
              ></el-switch>
            </template>
          </el-table-column>
          <el-table-column label="操作">
            <template slot-scope="scope">
              <el-button size="mini" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
              <el-button size="mini" type="danger" @click="handleDelete(scope.$index, scope.row)">删除</el-button>
            </template>
          </el-table-column>
        </el-table>-->
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      tableData: []
    };
  },
  methods: {
    deleteRow(index, rows) {
      rows.splice(index, 1);
    },
    //获取数据
    async getAddress() {
      let res = await this.$http.get("/colonelawait");
      console.log(res);
      this.tableData = res.data.data;
    }
  },
  created() {
    this.getAddress();
  }
};
</script>

<style scoped lang='scss'>
.grade {
  width: 100%;
  height: 100%;
  .teamInner {
    padding: 10px 0;
  }
}
.el-table {
  margin-top: 20px;
}
.cell{
  i{
    font-size: 20px;
    padding: 0 15px;
  }
}
</style>